From a499c2d2ddc31284451c8dcf752fd619cb69c662 Mon Sep 17 00:00:00 2001 From: "emellor@ewan" Date: Tue, 11 Oct 2005 10:30:13 +0100 Subject: [PATCH] Added doccomment. Signed-off-by: Ewan Mellor --- tools/python/xen/util/asserts.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tools/python/xen/util/asserts.py b/tools/python/xen/util/asserts.py index 78f4c1b4a8..dd3cb7f852 100644 --- a/tools/python/xen/util/asserts.py +++ b/tools/python/xen/util/asserts.py @@ -17,6 +17,11 @@ def isCharConvertible(c): + """Assert that the given value is convertible to a character using the %c + conversion. This implies that c is either an integer, or a character + (i.e. a string of length 1). + """ + assert (isinstance(c, int) or (isinstance(c, str) and len(c) == 1)), "%s is not convertible to a character" % c -- 2.30.2